package com.hyzh.hj212.test.excel;

import com.hyzh.hj212.dmo.entity.FieldInfoEntity;
import com.hyzh.hj212.dmo.entity.FieldPostfixEntity;
import com.hyzh.hj212.dmo.entity.SysCodeEntity;
import lombok.Data;

/**
 * @author songkui
 * @since 2024/6/14 11:42
 */
@Data
public class SysCodeInfo {

    private String code;

    private String name;

    private String unit;

    public SysCodeEntity buildEntity(){
        SysCodeEntity entity = new SysCodeEntity();
        entity.setCode(Integer.parseInt(this.code.trim()));
        entity.setName(this.name);
        return entity;
    }

    public FieldPostfixEntity buildPEntity(){
        FieldPostfixEntity  entity = new FieldPostfixEntity();
        entity.setFieldCode(this.code);
        entity.setFieldTitle(this.name);
        return entity;
    }


    public FieldInfoEntity buildFIEntity(){
        FieldInfoEntity entity = new FieldInfoEntity();
        entity.setCode(this.code);
        entity.setName(this.name);
        entity.setUnit(this.unit);
        return entity;

    }

}
